#include<stdio.h>
#include<stdlib.h>
typedef struct number
{
    int data;
    struct number *ptr;
}num;

num*  addnum(num *head,int adddata )
{
    num *current=head;
    num *add=(num*)malloc(sizeof(num));
    if(head==NULL)
    {
        head=add;
    }
   else
   {
        while(current->ptr!=NULL)
        {
            current=current->ptr;
        }
        current->ptr=add;
    }
    add->data=adddata;
    add->ptr=NULL;
    return head;
}

int findmax(num *head)
{
   num* current=head;
   int max=current->data;
   if(current->ptr!=NULL)
   {
       current=current->ptr;
   }
    
   
   while(current->ptr!=NULL)
   {    
       if(current->data>max)
       {
           max=current->data;
        }
       current=current->ptr;
   }
    if(current->data>max)
       {
           max=current->data;
        }
    return max;
   
}

int findmin(num* head) 
{
     num* current=head;
   int min=current->data;
  
       if(current->ptr!=NULL)
   {
       current=current->ptr;
   }
  
   while(current->ptr!=NULL)
   {    
       if(current->data<min)
       {
           min=current->data;
        }
       current=current->ptr;
   }
    if(current->data<min)
       {
           min=current->data;
        }
    return min;
}

int sumnum(num* head)
{
    num* current=head;
   int sum=current->data;
   
   
   
   
   while(current->ptr!=NULL)
   {    
       current=current->ptr;
       sum+=current->data;
   }
   
   return sum;
}

// void shownum(num* head)
// {
//     num* current=head;
//     while(current!=NULL)
//     {
//         printf("%d\n",current->data);
//         current=current->ptr;
//     }
//     printf("%d\n",current->data);
    
// }

int main()
{
    int a;
    num* head=NULL;
    while(1)
    {
        scanf("%d",&a);
        if(a==-1)
        {
            break;
        }
        else{
           head=addnum(head,a);
        }
    }
      
    int max=findmax(head);
    int min=findmin(head);
    int sum=sumnum(head);
    printf("The maximum,minmum and the total are:%d %d %d\n",max,min,sum);
    
     system("pause");
    return 0;
}